Fix: Replace ES6 getters/setters with ES5-compatible functions in HTML5 runtime (Closure Compiler error)#27
Closed
gui8515 wants to merge 1 commit intoSortaCore:masterfrom
Closed
Fix: Replace ES6 getters/setters with ES5-compatible functions in HTML5 runtime (Closure Compiler error)#27gui8515 wants to merge 1 commit intoSortaCore:masterfrom
gui8515 wants to merge 1 commit intoSortaCore:masterfrom
Conversation
Fusion comes with Google Closure Compiler, used in Final HTML5 builds to minify the code. Specifically, CF2.5 comes with v20161201, which doesn't have support for ES6, notably the ES6 getter/setter properties. (MMF2 last beta comes with v20120430.) You can tell which version of Closure you have by running `java.exe -jar "Fusion\Data\Runtime\compiler.jar" -- version` In CF2.5 build 296.1 and higher, you can specify your own Closure compiler version in Fusion > Tools > Preferences > General tab > HTML5 exporter. It's also possible to swap the jar file out, but Fusion may not understand the results. However, as of 296.9, the same ES6-incompatible 2016 version is still sent by CT, so we'll keep compatibility to that.
Owner
|
Accepted in commit 43da6cc . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes a critical issue preventing Clickteam Fusion 2.5 HTML5 builds when using extensions created with the DarkEdif SDK (SDK v20).
The Fusion HTML5 exporter uses the Google Closure Compiler, which does not support ES6 getters/setters and fails to transpile them to ES5.
Because of this, any extension using DarkEdif v20 cannot be exported as HTML5.
Problem
During HTML5 build, Fusion throws:
This comes from auto-generated code in
RuntimePropSet, inside the DarkEdif HTML5 runtime:Closure Compiler cannot convert ES6 getters/setters → ES5, so the entire HTML5 build fails.
Solution
Replaced the ES6 getter/setter with ES5-safe functions:
Before (ES6, incompatible)
After (ES5-compatible)
Additionally, all internal references were updated:
obj.setIndexSelected = x→obj.setSetIndexSelected(x)obj.setIndexSelected(read) →obj.getSetIndexSelected()Why this fix is necessary
✔ Restores HTML5 export support
✔ Keeps full compatibility with Smart Properties
✔ No behavior changes
✔ Only removes ES6 syntax that Closure cannot handle
Impact
Ready to merge
This PR contains the minimal and necessary change to re-enable HTML5 compatibility in DarkEdif SDK v20.